package singles

import (
	"github.com/go-resty/resty/v2"
	"showurl/static-file/kplayer/apis/config"
	httpUtils "showurl/static-file/kplayer/apis/utils/http"
)

type RespGetOutput struct {
	OutputList []struct {
		Path   string `json:"path"`
		Unique string `json:"unique"`
		Status string `json:"status"`
	} `json:"output_list"`
}

func GetOutput() *RespGetOutput {
	resp := &RespGetOutput{}
	httpUtils.ParseResponseJsonBody(func(r *resty.Request) (*resty.Response, error) {
		return r.Get(config.Host + `/v1.1/output`)
	}, resp)
	return resp
}

/*
{
    "output_list": [
        {
            "path": "rtmp://live-push.bilivideo.com/live-bvc/?streamname=live_79447841_48260531&key=62650205ad3a1def078a6b84614ded92&schedule=rtmp&pflag=1",
            "unique": "9E7924EAFBF1ED7BA03E6BD12562A6CA",
            "status": "CONNECTED"
        }
    ]
}
*/
